package com.test

import com.subpackage.ContrastFile
import javax.script.ScriptEngineManager
import kotlin.test.Test

class KotlinTest {


    init {

        System.setProperty("LOG_PATH", "E:\\WorkSpace\\IDEA\\Java\\PackProject\\data")
    }


    @Test
    fun igTest() {


        val str = "D:\\WorkSpace\\LayaBox\\CoinPusher\\staging\\web\\cache.txt"

        val cf = ContrastFile()

        println(cf.validatePath(str, "**/*.txt"))
        println(cf.validatePath("cache.txt", "*.txt"))
        println(cf.validatePath(str, "*.txt"))
        println(cf.validatePath(str, "**/cache.txt"))
        println(cf.validatePath(str, "**/staging/**")) // 必须使用/


    }

    @Test
    fun test() {


        val script = """
        println("Hello from external script!")
    """.trimIndent()

        val scriptEngineManager = ScriptEngineManager()
        scriptEngineManager.bindings

        val kotlinEngine = scriptEngineManager.getEngineByExtension("kts")

        scriptEngineManager.engineFactories.forEach {
            println(it.extensions)
        }

//        kotlinEngine?.eval(script)

    }

}